#define  _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;

//最长定差子序列
class Solution {
public:
    int longestSubsequence(vector<int>& arr, int difference) {
        //创建dp表
        //初始化
        //填表
        //返回值
        int n = arr.size();
        unordered_map<int, int> hash;
        hash[arr[0]] = 1;
        int ret = 1;

        for (int i = 1; i < n; i++)
        {
            hash[arr[i]] = hash[arr[i] - difference] + i;
            ret = max(ret, hash[arr[i]]);
        }
        return ret;
    }
};
int main()
{

	return 0;
}

